# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=netscan2
pkgver=60.3d02ba1
pkgrel=3
epoch=1
groups=('blackarch' 'blackarch-scanner' 'blackarch-recon')
pkgdesc='Active / passive network scanner.'
arch=('any')
url='https://github.com/walchko/netscan2'
license=('MIT')
depends=('python2' 'python2-pcapy'  'python2-dpkt' 'mitmproxy' 'python2-nose'
         'python2-simplejson' 'python2-requests' 'python2-netaddr'
         'python2-awake')
makedepends=('git' 'python2-setuptools' 'python2-build-utils')
source=("git+https://github.com/walchko/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  python2 setup.py build
}

package() {
  cd $pkgname

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.rst
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

